<?php
$criteria = Quiz::getModel('QUIZ-SEARCH',array('q'=>$q));
	if($criteria)	
	{
	$user=$criteria->user_id;
	$id=Role::model()->find("id=?",array($user));
	$name=$id->name;	
echo "<br>";
echo "Quiz Name        :          ".$criteria->title."<br>";
echo "Quiz Description :          ".$criteria->description."<br>";
echo "Autor            :          ".$name."<br>";
echo "<b>Play Time     :          ".$criteria->time."  Minutes<br>";
$this->widget('application.extensions.fancybox.EFancyBox', 
    array( 'target'=>'a#quizid', 
            'config'=>array( 
                'titleShow' => true, 
    			'height' =>'50%',
				'width'	 =>'50%',
    			'scrolling' => 'No',
            )
        )
    );


if (Yii::app()->user->isGuest) {

echo '<a id="quizid" href="'.ApplicationConfig::getURL("admin", "login", "login",array('qid'=>$criteria->id)).'">start Quiz</a>';

}
else 
echo '<a href="'.ApplicationConfig::getURL("", "site","quiz",array('qid'=>$criteria->id)).'">start Quiz</a>';

	
	}
else 
echo "QUIZ NOT AVAILABLE, PLEASE TRY AGAIN.";